package com.eco.fanliapp.service.impl;

import com.eco.fanliapp.common.response.ServerResponse;
import com.eco.fanliapp.entity.SyNewsType;
import com.eco.fanliapp.dao.SyNewsTypeMapper;
import com.eco.fanliapp.service.ISyNewsTypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 消息类型模板 服务实现类
 * </p>
 *
 * @author jobob
 * @since 2019-11-28
 */
@Service
public class SyNewsTypeServiceImpl extends ServiceImpl<SyNewsTypeMapper, SyNewsType> implements ISyNewsTypeService {
    @Autowired
    private SyNewsTypeMapper syNewsTypeMapper;

    @Override
    public ServerResponse findSyNewsTypeList(Integer companyId) {
        List<SyNewsType> list = syNewsTypeMapper.findSyNewsTypeList(companyId);
        if(list != null && list.size() > 0){
            return ServerResponse.createBySuccess("查询成功",list);
        }
        return ServerResponse.createByErrorCodeMessage(201,"暂无数据");
    }
}
